import Vue from 'vue'
import VueRouter from 'vue-router'
// 一级
import Login from '../views/login.vue'
import Layout from '../views/layout.vue'
// 二级
import Home from '../views/home.vue'
import Classify from '../views/classify.vue'
import Vehicle from '../views/vehicle.vue'
import My from '../views/my.vue'

Vue.use(VueRouter)

const routes = [
  { path: '/login', component: Login },
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    children: [
      { path: '/home', component: Home },
      { path: '/classify', component: Classify },
      { path: '/vehicle', component: Vehicle },
      { path: '/my', component: My }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
